package cn.itsource.pet.controller;

import cn.itsource.basic.util.JsonResult;
import cn.itsource.pet.domain.SearchMasterMessage;
import cn.itsource.pet.query.SearchMasterMessageQuery;
import cn.itsource.pet.service.IPetTypeService;
import cn.itsource.pet.service.ISearchMasterMessageService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * department控制层
 */
@RestController
@RequestMapping("/searchMasterMessage")
@Api(tags = "宠物类型管理")
public class SearchMasterMessageController {
    @Resource
    private ISearchMasterMessageService searchMasterMessageService;
    @PostMapping("/publish")
    public JsonResult publish(@RequestBody  @Valid SearchMasterMessage searchMasterMessage){
        return searchMasterMessageService.publish(searchMasterMessage);
    }
    @PostMapping("/findPage")
    public JsonResult findPage(@RequestBody SearchMasterMessageQuery messageQuery){
        return JsonResult.createSuccess(searchMasterMessageService.findPage(messageQuery));
    }
    @PostMapping("/shenghe")
    public JsonResult shenghe(@RequestBody SearchMasterMessage message){
        return searchMasterMessageService.shenghe(message);
    }
}





